import config from './config.js'
//  返回一个Promise
export default (url, data = {}, method = "GET") => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: config.host + url,
			data,
			method,
			// 成功
			success(res) {
				resolve(res.data)
			},
			// 失败
			fail(err) {
				reject(err)
			}
		})
	})
}